package com.cdtu.outtake.controller;

import com.cdtu.outtake.common.Result;
import com.cdtu.outtake.domain.School;
import com.cdtu.outtake.service.ISchoolService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author : shl
 * @Date 2024/3/4 18:01
 */
@RestController
@RequestMapping("/school")
@RequiredArgsConstructor
public class SchoolController {
    private final ISchoolService schoolService;

    @GetMapping
    public Result<List<School>> schools() {
        return Result.ok(schoolService.findAllSchools());
    }
}
